/*
 * Copyright 2007 Peter Zelenay.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *     
*/
package net.zelenay.jcrviewer.table;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.Observable;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 
 * @author Peter Zelenay
 *
 */
public class PropertyPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static final Log LOG = LogFactory.getLog(PropertyPanel.class);
	
	private JTable propertyTable;
	
	private final JScrollPane scroller = new JScrollPane();

	public PropertyPanel() {
		super();
		setLayout(new GridBagLayout());
		GridBagConstraints cs = new GridBagConstraints();
		cs.fill = GridBagConstraints.BOTH;
		cs.gridy = 1;
		cs.weightx = 1;
		cs.weighty = 1;
		add(scroller, cs);
	}

	public JTable getPropertyTable() {
		return propertyTable;
	}

	public void setPropertyTable(JTable propertyTable) {
		this.propertyTable = propertyTable;
		scroller.setViewportView(propertyTable);		
	}

	public void update(Observable o, Object arg) {
		LOG.error(o);
	}
	
}
